package com.xinqi.modules.prepare.prepare.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xinqi.common.mybatis.data.entity.BaseEntity;
import com.xinqi.modules.prepare.common.domain.PrepareBaseParam;
import com.xinqi.modules.prepare.prepare.enums.PrepareMemberRoleEnum;
import com.xinqi.modules.prepare.prepare.enums.PrepareOperateTypeEnum;
import com.xinqi.modules.prepare.prepare.enums.PrepareSubOperateTypeEnum;
import com.xinqi.modules.prepare.prepare.enums.PrepareTypeEnum;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 备课区操作记录表实体层
 *
 * @author: system
 * @date: 2023/03/19
 */
@Setter
@Getter
@TableName("pl_prepare_operate_log")
public class PrepareOperateLogEntity extends BaseEntity implements PrepareBaseParam {
    /**
     * 备课区id
     */
    @TableField(value = "prepare_id")
    private Long prepareId;
    /**
     * 类型，1:互动课件；2:资料；3:作业；4:测评；5:讨论；6:互动视频；8:公告；99:题库；10:成员
     */
    @TableField(value = "type")
    private PrepareTypeEnum type;
    /**
     * 目标对象ID
     */
    @TableField(value = "target_id")
    private Long targetId;
    /**
     * 目标对象名称
     */
    @TableField(value = "target_name")
    private String targetName;
    /**
     * 操作记录
     */
    @TableField(value = "title")
    private String title;
    /**
     * 操作者
     */
    @TableField(value = "operator")
    private Long operator;
    /**
     * 操作者名称
     */
    @TableField(value = "operate_name")
    private String operateName;
    /**
     * 操作者头像
     */
    @TableField(value = "operate_avatar")
    private String operateAvatar;
    /**
     * 操作类型：FILE_EDIT-文件编辑；FILE_DEL-文件删除；MEMBER_CHANGE-成员变动；QUESTION_EDIT-编辑试题，QUESTION_DEL-删除试题
     */
    @TableField(value = "operate_type")
    private PrepareOperateTypeEnum operateType;
    /**
     * 操作子类型：ADD-添加了；EDIT-编辑了；CHANGE-变更了；DEL-删除了
     */
    @TableField(value = "operate_sub_type")
    private PrepareSubOperateTypeEnum operateSubType;
    /**
     * 操作内容
     */
    @TableField(value = "operate_content")
    private String operateContent;
    /**
     * 恢复截止时间
     */
    @TableField(value = "deadline_time")
    private LocalDateTime deadlineTime;
    /**
     * 是否还原
     */
    @TableField(value = "is_restore")
    private Integer isRestore;
    /**
     * 之前角色，LEADER-组长；ADMIN-管理员；MEMBER-组员
     */
    @TableField(value = "before_role")
    private PrepareMemberRoleEnum beforeRole;
    /**
     * 之后角色，LEADER-组长；ADMIN-管理员；MEMBER-组员
     */
    @TableField(value = "after_role")
    private PrepareMemberRoleEnum afterRole;
    /**
     * 扩展字段
     */
    @TableField(value = "extend")
    private String extend;
}
